#ifndef PSMATRIX_H
#define PSMATRIX_H


/**
 * Container for column-mayor mxn-matrix with ld.
 * @author	Marcel Gehrmann
 */
class psMatrix
{
public:
	psMatrix();
	~psMatrix();

	double getComp(const int row, const int col) const;
	double* getCompPtr() const;
	int getRowCount() const;
	int getColCount() const;
	int getLeadingDimension() const;
	bool isSquared() const;

	void print(const int digits = 4) const;

	void setComp(const int row, const int col, const double comp);

	void setSize(const int rows, const int cols);
	void setSize(const int rows, const int cols, const int ld);
	void setSizeSqrd(const int dim);
	void setSizeSqrd(const int dim, const int ld);

	void setToIntIntervalInclLd();
	void setToRandomInclLd();
	void setToZero();

protected:
	double* m_pComp; // components; column-mayor (!)

	int m_rows; // count of rows
	int m_cols; // count of cols
	int m_ld; // leading dimension

	void initNewSize();
};


#endif